package com.cz.ssyx.activity.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cz.ssyx.model.activity.ActivityInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cz.ssyx.model.activity.ActivityRule;
import com.cz.ssyx.model.order.CartInfo;
import com.cz.ssyx.model.product.SkuInfo;
import com.cz.ssyx.vo.activity.ActivityRuleVo;
import com.cz.ssyx.vo.order.CartInfoVo;
import com.cz.ssyx.vo.order.OrderConfirmVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 活动表 服务类
 * </p>
 *
 * @author Joker
 * @since 2024-04-20
 */
public interface ActivityInfoService extends IService<ActivityInfo> {

    //查询活动列表
    IPage<ActivityInfo> selectPage(Page<ActivityInfo> pageParam);

    //查询活动规则
    Map<String, Object> findActivityRuleList(Long id);

    //保存活动规则
    void saveActivityRule(ActivityRuleVo activityRuleVo);

    //根据关键词查询商品信息
    List<SkuInfo> findSkuInfoByKeyword(String keyword);

    Map<Long, List<String>> findActivity(List<Long> skuEsIdList);

    //获取商品的活动信息和优惠券
    Map<String, Object> findActivityAndCoupon(Long skuId, Long userId);

    //获取带有优惠活动和优惠券的购物车信息
    OrderConfirmVo findCartActivityAndCoupon(List<CartInfo> cartInfoList, Long userId);

    //把购物车里的每个商品都按照活动分组
    List<CartInfoVo> findCartActivityList(List<CartInfo> cartInfoList);
}
